home *** CD-ROM | disk | FTP | other *** search
/ Euroscene 2 / Euroscene 2.iso / USEFUL / DeliTracker130 / Developer / Developer.run / Examples / M.O.N.s < prev    next >
Encoding:
Text File  |  1992-09-23  |  3.7 KB  |  206 lines

  1.  
  2.     incdir    "Includes:"
  3.     include    "misc/DeliPlayer.i"
  4.  
  5. ;
  6. ;
  7.     SECTION Player,Code
  8. ;
  9. ;
  10.  
  11.     PLAYERHEADER PlayerTagArray
  12.  
  13.     dc.b '$VER: Maniacs of Noise player module V1.0 (11 Sep 92)',0
  14.     even
  15.  
  16. PlayerTagArray
  17.     dc.l    DTP_PlayerVersion,1
  18.     dc.l    DTP_PlayerName,PName
  19.     dc.l    DTP_Creator,CName
  20.     dc.l    DTP_Check2,Chk
  21.     dc.l    DTP_Interrupt,Int
  22.     dc.l    DTP_SubSongRange,SubSong
  23.     dc.l    DTP_InitPlayer,InitPlay
  24.     dc.l    DTP_EndPlayer,EndPlay
  25.     dc.l    DTP_InitSound,InitSnd
  26.     dc.l    DTP_EndSound,RemSnd
  27.     dc.l    DTP_PrevSong,PrevSub
  28.     dc.l    DTP_NextSong,NextSub
  29.     dc.l    TAG_DONE
  30.  
  31. *-----------------------------------------------------------------------*
  32. ;
  33. ; Player/Creatorname und lokale Daten
  34.  
  35. PName    dc.b 'M.O.N.',0
  36. CName    dc.b 'Maniacs of Noise/Charles Deenen,',10
  37.     dc.b 'adapted by Delirium',0
  38.     even
  39. mon_data    dc.l 0
  40.  
  41. MaxSong        dc.w 0
  42. MaxSong2    dc.w 0
  43.  
  44. *-----------------------------------------------------------------------*
  45. ;
  46. ;Interrupt für Replay
  47.  
  48. Int
  49.     movem.l    d0-d7/a0-a6,-(sp)
  50.     move.l    mon_data(pc),a0
  51.     jsr    4(a0)                ; DudelDiDum
  52.     movem.l    (sp)+,d0-d7/a0-a6
  53.     rts
  54.  
  55. *-----------------------------------------------------------------------*
  56. ;
  57. ; Testet auf Maniacs of Noise-Modul
  58.  
  59. Chk
  60.     move.l    dtg_ChkData(a5),a0
  61.     move.l    dtg_ChkSize(a5),d1
  62.  
  63.     moveq    #-1,d0                ; Modul nicht erkannt (default)
  64.  
  65.     cmpi.w    #$4efa,$00(a0)
  66.     bne.s    Unknown
  67.     cmpi.w    #$4efa,$04(a0)
  68.     bne.s    Unknown
  69.     cmpi.w    #$4efa,$08(a0)
  70.     bne.s    Unknown
  71.     cmpi.w    #$4efa,$0c(a0)
  72.     beq.s    Unknown
  73.  
  74. Check1    cmpi.w    #$4BFA,$00(a0)
  75.     bne.s    Check2
  76.     cmpi.w    #$0280,$04(a0)
  77.     bne.s    Check2
  78.     cmpi.l    #$000000FF,$06(a0)
  79.     bne.s    Check2
  80.     cmpi.l    #$5300B02D,$14(a0)
  81.     beq.s    FindLastSong
  82. Check2    addq.l    #2,a0
  83.     subq.l    #2,d1
  84.     bpl.s    Check1
  85.     bra.s    Unknown
  86. FindLastSong
  87.     move.w    $0002(a0),d1
  88.     lea    0(a0,d1.w),a1
  89.     move.w    $0018(a0),d1
  90.     lea    0(a1,d1.w),a1
  91.     moveq    #0,d0
  92.     move.b    2(a1),d0
  93.     move.w    d0,MaxSong2
  94.  
  95.     moveq    #0,d0                ; Modul erkannt
  96. Unknown
  97.     rts
  98.  
  99. *-----------------------------------------------------------------------*
  100. ;
  101. ; Set min. & max. subsong number
  102.  
  103. SubSong
  104.     moveq    #1,d0                ; min.
  105.     move.w    MaxSong(pc),d1            ; max.
  106.     rts
  107.  
  108. *-----------------------------------------------------------------------*
  109.  
  110. ; Init Player
  111.  
  112. InitPlay
  113.     moveq    #0,d0
  114.     move.l    dtg_GetListData(a5),a0        ; Function
  115.     jsr    (a0)
  116.     move.l    a0,mon_data
  117.  
  118.     move.w    MaxSong2(pc),MaxSong        ; copy buffer
  119.  
  120.     move.l    dtg_AudioAlloc(a5),a0        ; Function
  121.     jsr    (a0)                ; returncode is already set !
  122.     rts
  123.  
  124. *-----------------------------------------------------------------------*
  125. ;
  126. ; End Player
  127.  
  128. EndPlay
  129.     move.l    dtg_AudioFree(a5),a0        ; Function
  130.     jsr    (a0)
  131.     rts
  132.  
  133. *-----------------------------------------------------------------------*
  134.  
  135. ; Init Sound
  136.  
  137. InitSnd
  138.     move.l    a5,-(sp)
  139.     moveq    #$00,d0
  140.     move.l    mon_data(pc),a0
  141.     jsr    (a0)
  142.     move.l    (sp)+,a5
  143.  
  144.     move.l    a5,-(sp)
  145.     moveq    #$00,d0
  146.     move.w    dtg_SndNum(a5),d0
  147.     moveq    #$00,d1
  148.     move.l    mon_data(pc),a0
  149.     jsr    $0008(a0)
  150.     move.l    (sp)+,a5
  151.     rts
  152.  
  153. *-----------------------------------------------------------------------*
  154. ;
  155. ; Remove Sound
  156.  
  157. RemSnd
  158.     move.l    a5,-(sp)
  159.     moveq    #$00,d0
  160.     moveq    #$00,d1
  161.     move.l    mon_data(pc),a0
  162.     jsr    $0008(a0)
  163.     move.l    (sp)+,a5
  164.     rts
  165.  
  166. *-----------------------------------------------------------------------*
  167. ;
  168. ; Previous SubSong
  169.  
  170. PrevSub
  171.     cmpi.w    #1,dtg_SndNum(a5)        ; min. subsongnumber reached ?
  172.     beq.s    PrevSubEnd
  173.  
  174.     move.l    dtg_StopInt(a5),a0
  175.     jsr    (a0)
  176.     bsr    RemSnd
  177.     subq.w    #1,dtg_SndNum(a5)        ; Vorheriger Sound
  178.     bsr    InitSnd
  179.     move.l    dtg_StartInt(a5),a0
  180.     jsr    (a0)
  181. PrevSubEnd
  182.     rts
  183.     
  184. *-----------------------------------------------------------------------*
  185. ;
  186. ; Next SubSong
  187.  
  188. NextSub
  189.     move.w    dtg_SndNum(a5),d0
  190.     cmp.w    MaxSong(pc),d0            ; max. subsongnumber reached ?
  191.     beq.s    NextSubEnd
  192.  
  193.     move.l    dtg_StopInt(a5),a0
  194.     jsr    (a0)
  195.     bsr    RemSnd
  196.     addq.w    #1,dtg_SndNum(a5)        ; Nächster Sound
  197.     bsr    InitSnd
  198.     move.l    dtg_StartInt(a5),a0
  199.     jsr    (a0)
  200. NextSubEnd
  201.     rts
  202.  
  203. *-----------------------------------------------------------------------*
  204.  
  205.  
  206.